package at.fhooe.mc.view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Polygon;

import javax.swing.JPanel;

public class JTrianglePanelUpSmall extends JPanel  {

	private Color trianglecolor = Color.gray;

	public Color getTrianglecolor() {
		return trianglecolor;
	}

	public void setTrianglecolor(Color trianglecolor) {
		this.trianglecolor = trianglecolor;
		this.repaint();
	}

protected void paintComponent(Graphics g) {

		super.paintComponent(g);

		Point p1 = new Point(10,0);
		Point p2 = new Point(15,6);
		Point p3 = new Point(4,6);

		int[] xs = { p1.x, p2.x, p3.x };
		int[] ys = { p1.y, p2.y, p3.y };
		Polygon triangle = new Polygon(xs, ys, xs.length);

		g.setColor(trianglecolor);
		g.fillPolygon(triangle);

	}

}
